import Vue from 'vue'
import VueRouter from 'vue-router'
import Recruitment from '../views/Recruitment/recruitment.vue'
import HomeView from '../views/HomeView/home-view.vue'
import Policy from '../views/Policy/policy.vue'
import Details from '../views/Policy/details.vue'
import Active from "@/views/Active/active.vue"
import Quick from "@/views/Quick/quick.vue";
import Details1 from "@/views/Policy/details1.vue";
import Details2 from '@/views/Policy/details2.vue'
import Details3 from '@/views/Policy/details3.vue'
import Details4 from '@/views/Policy/details4.vue'
import Details5 from '@/views/Policy/details5.vue'
import Fair from "@/views/Active/fair.vue";
import Mush from "@/views/Active/mush.vue";
import Campus from "@/views/Active/campus.vue";
import Activity from "@/views/Active/activity.vue";
import Introduce from "@/views/Active/introduce.vue";
import Enterprises from "@/views/Active/enterprises.vue";
import Position from "@/views/Active/position.vue";
import Result from "@/views/Quick/result.vue";
import Nearby from "@/views/Nearby/nearby.vue";
import Results from "@/views/Nearby/results.vue";
import Supermarket from "@/views/Supermarket/supermarket.vue";
import ShortJob from "@/views/Supermarket/short-job.vue";
import JobDetail from "@/views/Supermarket/job-detail.vue";
import CompanyDetail from "@/views/Supermarket/company-detail.vue";
import OddJobDetail from "@/views/Supermarket/odd-job-detail.vue";
import RecruiterEvaluate from "@/views/Supermarket/recruiter-evaluate.vue";
import HunterEvaluate from "@/views/Supermarket/hunter-evaluate.vue";
import Detail from "@/views/Recruitment/detail.vue";
import companyDetails from "@/views/Active/company-details.vue";

Vue.use(VueRouter)

const originalReplace = VueRouter.prototype.replace
const routes = [
  {
    path: '/',
    name: 'HomeView',
    component: HomeView,
    meta: { title: "首页" }
  },
  {
    path: '/Recruitment',
    name: 'Recruitment',
    component: Recruitment,
    // component: () => import('@/views/Recruitment/detail.vue'),
    meta: { title: "招聘求职",
      keepAlive: true,
    }
  },
  {
    path: '/Detail',
    name: 'Detail',
    component: Detail,
    meta: { title: "职位详情" }
  },
  {
    path: '/Policy',
    name: 'Policy',
    component: Policy,
    redirect: '/Policy/Details1',
    meta: { title: "政策补贴" },
    children:[
      {
        path: 'Details1',
        component: Details1,
      },
      {
        path: 'Details2',
        component: Details2
      },
      {
        path: 'Details3',
        component: Details3
      },
      {
        path: 'Details4',
        component: Details4
      },
      {
        path: 'Details5',
        component: Details5
      },
    ]
  },
  {
    path: '/Details',
    name: 'Details',
    component: Details,
    meta: { title: "政策详情" }
  },
  {
    path: '/Active',
    name: 'Active',
    component: Active,
    redirect: '/Active/Fair',
    meta: { title: "招聘会" },
    children:[
      {
        path: 'Fair',
        component: Fair,

      },
      {
        path: 'Mush',
        component: Mush,

      },
      {
        path: 'Campus',
        component: Campus,

      },
    ]
  },
  {
    path: '/Activity',
    name:'Activity',
    component: Activity,
    redirect: '/Activity/Introduce',
    meta: { title: "招聘会" },
    children: [
      {
        path: 'Introduce',
        component: Introduce,
        meta: { title: "活动介绍" },
      },
      {
        path: 'Enterprises',
        component: Enterprises,
        meta: { title: "参会企业" },
      },
      {
        path: 'Position',
        component: Position,
        meta: { title: "参会岗位" }
      },
    ]
  },
  {
    path: '/Quick',
    name: 'Quick',
    component: Quick,
    meta: { title: "快速就业" }
  },
  {
    path: '/Result',
    name: 'Result',
    component: Result,
    meta: { title: "匹配岗位" }
  },
  {
    path: '/Nearby',
    name: 'Nearby',
    component: Nearby,
    meta: { title: "家门口就业" }
  },
  {
    path: '/Results',
    name: 'Results',
    component: Results,
    meta: { title: "匹配岗位" }
  },
  {
    path: '/Supermarket',
    name: 'Supermarket',
    component: Supermarket,
    meta: { title: "零工超市" }
  },
  {
    path: '/ShortJob',
    name: 'ShortJob',
    component: ShortJob,
    meta: { title: "零活分类" }
  },
  {
    path: '/JobDetail',
    name: 'JobDetail',
    component: JobDetail,
    meta: { title: "零活详情" }
  },
  {
    path: '/CompanyDetail',
    name: 'CompanyDetail',
    component: CompanyDetail,
    redirect: '/CompanyDetail/RecruiterEvaluate',
    meta: { title: "公司详情" },
    children: [
      {
        path: 'RecruiterEvaluate',
        component: RecruiterEvaluate
      },
      {
        path: 'HunterEvaluate',
        component: HunterEvaluate
      },
    ]
  },
  {
    path: '/OddJobDetail',
    name: 'OddJobDetail',
    component: OddJobDetail,
  },
  {
    path: '/company-details',
    name: 'company-details',
    component: companyDetails,
    meta: { title: "企业详情" },
  }

]

const router = new VueRouter({
  routes
})

export default router
